<?	session_start(); 
	if(isset($_SESSION['id']) & isset($_SESSION['pass']))
	{
	require("koneksi.php");
	$query=mysql_query("select * from mk111 order by kodemk");
	//$row=mysql_fetch_row($query);
?>
<center>
<table border="1">
	<th colspan="17">
		Tampilan Semua Data Mata Kuliah Berkehidupan Bermasyarakat (MBB)/ Kode Golongan 5
	</th>
	<tr>
		<td>Kode MK</td>
		<td>Nama MK</td>
		<td>SKS</td>
		<td>Prasyarat SKS</td>
		<td>Prasyarat 1</td>
		<td>Prasyarat 2</td>
		<td>Prasyarat 3</td>
		<td>Prasyarat 4</td>
		<td>Prasyarat 5</td>
		<td>Prasyarat 6</td>
		<td>Prasyarat 7</td>
		<td>Prasyarat 8</td>
		<td>Prasyarat 9</td>
		<td>Prasyarat 10</td>
		<td>Prasyarat Grade</td>
		<td colspan="2">Action</td>
	</tr>
	<?
		
			//$substr = substr($row[0],2,1);
			//$querysubstr=mysql_query("select substring(kodemk,3,1) from mk111 order by kodemk");
			while($row=mysql_fetch_row($query))
			{
				//echo "$rowsubstr[0]";
				//if($substr==1)
				//{
				$substr = substr($row[0],2,1);
					if($substr[0]==5)
					{
						echo "<tr><td>$row[0]</td>
					<td>$row[1]</td>
					<td>$row[2]</td>
					<td>$row[3]</td>
					<td>$row[4]</td>
					<td>$row[5]</td>
					<td>$row[6]</td>
					<td>$row[7]</td>
					<td>$row[8]</td>
					<td>$row[9]</td>
					<td>$row[10]</td>
					<td>$row[11]</td>
					<td>$row[12]</td>
					<td>$row[13]</td>
					<td>$row[14]</td>
					<td><a href=form_edit_mk.php?kodemk=$row[0]>Edit</a></td>
					<td><a href=del_mk.php?kodemk=$row[0]>Delete</a></td>
					</tr>";
					}
					else
					{
				
					}
			}
		
	?>
	<tr>
		<td colspan="17"><a href="form_add_mk.php">Tambah Mata Kuliah</a></td>
	</tr>
	<tr>
		<td colspan="17"><a href="menu_mata_kul.php">Back to Menu Mata Kuliah</a></td>
	</tr>
	<tr>
		<td colspan="17"><a href="menu_admin.php">Back to Menu Admin</a></td>
	</tr>
</table>
</center>
<? 
	}
	else
	echo "Silahkan <a href='index.php'>Login</a> dulu.";
?>